package com.ruoyi.sale.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sale.mapper.SalesDeliveryItemMapper;
import com.ruoyi.sale.domain.SalesDeliveryItem;
import com.ruoyi.sale.service.ISalesDeliveryItemService;
import com.ruoyi.common.core.text.Convert;

/**
 * 销售发货明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class SalesDeliveryItemServiceImpl implements ISalesDeliveryItemService 
{
    @Autowired
    private SalesDeliveryItemMapper salesDeliveryItemMapper;

    /**
     * 查询销售发货明细
     * 
     * @param itemId 销售发货明细主键
     * @return 销售发货明细
     */
    @Override
    public SalesDeliveryItem selectSalesDeliveryItemByItemId(Long itemId)
    {
        return salesDeliveryItemMapper.selectSalesDeliveryItemByItemId(itemId);
    }

    /**
     * 查询销售发货明细列表
     * 
     * @param salesDeliveryItem 销售发货明细
     * @return 销售发货明细
     */
    @Override
    public List<SalesDeliveryItem> selectSalesDeliveryItemList(SalesDeliveryItem salesDeliveryItem)
    {
        return salesDeliveryItemMapper.selectSalesDeliveryItemList(salesDeliveryItem);
    }

    /**
     * 新增销售发货明细
     * 
     * @param salesDeliveryItem 销售发货明细
     * @return 结果
     */
    @Override
    public int insertSalesDeliveryItem(SalesDeliveryItem salesDeliveryItem)
    {
        return salesDeliveryItemMapper.insertSalesDeliveryItem(salesDeliveryItem);
    }

    /**
     * 修改销售发货明细
     * 
     * @param salesDeliveryItem 销售发货明细
     * @return 结果
     */
    @Override
    public int updateSalesDeliveryItem(SalesDeliveryItem salesDeliveryItem)
    {
        return salesDeliveryItemMapper.updateSalesDeliveryItem(salesDeliveryItem);
    }

    /**
     * 批量删除销售发货明细
     * 
     * @param itemIds 需要删除的销售发货明细主键
     * @return 结果
     */
    @Override
    public int deleteSalesDeliveryItemByItemIds(String itemIds)
    {
        return salesDeliveryItemMapper.deleteSalesDeliveryItemByItemIds(Convert.toStrArray(itemIds));
    }

    /**
     * 删除销售发货明细信息
     * 
     * @param itemId 销售发货明细主键
     * @return 结果
     */
    @Override
    public int deleteSalesDeliveryItemByItemId(Long itemId)
    {
        return salesDeliveryItemMapper.deleteSalesDeliveryItemByItemId(itemId);
    }
}
